<!--
 * @Author: Allen
 * @Date: 2021-01-20 09:25:04
 * @Description: 抱怨身处黑暗，不如提灯前行。愿你在自己存在的地方，成为一束光，照亮世界的一角
 * @LastEditTime: 2021-01-20 09:32:13
 * @LastEditors: Allen
 * @FilePath: \WMS\src\components\wms\wmsEjectWindows\wmsDeliveryGo\edit.vue
 * @Additional: 出库去向弹框表格
-->

<template>
  <section class="carTypeConfig">
    <el-dialog
      v-dialogDrag
      title="合作伙伴信息查询"
      :visible.sync="curPopupsVisible"
      width="1000px"
      center
      @close="sendCode"
      :close-on-click-modal="false"
      :append-to-body="true"
    >
      <dialogHeader slot="title" :title="'合作伙伴信息查询'" :styleType="$store.state.app.dialogType"></dialogHeader>
      <one-table-template
        ref="multipleTable"
        :dynamicButtons="tableButtons"
        :dynamicComponents="tableComponents"
        :dynamicApiConfig="apiConfig"
        :dynamicTableCols="tableCols"
        :dynamicFormFields="formField"
        :dynamicIsShowSelect="false"
        :dynamicIsInitTable="true"
        :dynamicTableDefultHeight="400"
      />
    </el-dialog>
  </section>
</template>
<script>
import { oneTableWithViewTemplateMixins } from "@/components/mixins/oneTableWithViewTemplateMixins";
import { valueObjectMixins } from "@/components/mixins/valueObjectMixins";
import { basedataApi } from "@/api/wms/basedata";
import OneTableTemplate from "@/components/wms/templates/oneTable";

export default {
  // 组件混入对象：{data[listQuery] methods[queryTable]}
  mixins: [oneTableWithViewTemplateMixins, valueObjectMixins],
  components: {
    OneTableTemplate,
    dialogHeader: () => import("@/components/dialogHeader") //弹窗标题
  },
  data() {
    return {
      // 网格查询API配置对象
      apiConfig: basedataApi.queryOutStorage, //合作伙伴信息查询
      // 动态组件-按钮
      tableButtons: [
        {
          compKey: "btnKey1",
          size: "small",
          clickEvent: () => this.queryTable(1),
          text: "查询",
          position: "top"
        },
        {
          compKey: "btnKey2",
          size: "small",
          clickEvent: () => this.sendCode(this.codeField, "PART_NAME"),
          text: "确认",
          position: "bottom"
        },
        {
          compKey: "btnKey3",
          type: "",
          size: "small",
          clickEvent: () => this.reset(),
          text: "重置",
          position: "top"
        }
      ],
      // 动态组件-查询条件
      tableComponents: [
        // 显示组件
        {
          compKey: "compKey1",
          labelName: "合作伙伴编码",
          codeField: "PARTNER_CODE",
          component: () => import("@/components/org/commonInput"),
          type: "inputText",
          isMust: true
        },
        {
          compKey: "compKey2",
          labelName: "合作伙伴名称",
          codeField: "PARTNER_SHORT_NAME",
          component: () => import("@/components/org/commonInput"),
          type: "inputText",
          isMust: true
        }
      ],
      // 动态生成网格列
      tableCols: [
        {
          prop: "OUT_STORAGE_CODE",
          label: "合作伙伴编码",
          align: "center"
        },
        {
          prop: "PARTNER_SHORT_NAME",
          label: "合作伙伴名称",
          align: "center"
        }
      ],
      //表单查询数据（查询条件）
      formField: {
        PARTNER_CODE: "",
        PARTNER_SHORT_NAME: ""
      },
      handleTableRowData: {
        value: "PARTNER_CODE",
        text: "PARTNER_SHORT_NAME"
      }
    };
  },
  methods: {}
};
</script>
